package com.starlink.model.util;

import com.starlink.model.dtomapper.MallBooksOrderDtoMapper;
import com.starlink.model.domain.MallBooksOrderDO;
import com.starlink.model.vo.MallBooksOrderVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class MallBooksOrderConvert {

    public static List<MallBooksOrderVO> buildMallBooksOrderVoList(List<MallBooksOrderDO> mallBooksOrderDOList) {
        if (CollectionUtils.isEmpty(mallBooksOrderDOList)) {
            return Lists.newArrayList();
        }
        List<MallBooksOrderVO> mallBooksOrderVOList = new ArrayList<>();
        for (MallBooksOrderDO mallBooksOrderDO : mallBooksOrderDOList) {
            mallBooksOrderVOList.add(MallBooksOrderDtoMapper.INSTANCE.do2VO(mallBooksOrderDO));
        }

        return mallBooksOrderVOList;
    }
}
